﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

// ReSharper disable InconsistentNaming
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
// ReSharper disable StringLiteralTypo

namespace Instrument.Ports
{
    internal static class SR
    {
        internal static string Port_already_open = "Port already open";
        internal static readonly string InvalidNullEmptyArgument = "Invalid Null Empty Argument";
        internal static readonly string ArgumentOutOfRange_Enum = "Argument OutOfRange Enum";
        internal static string PortNameEmpty_String = "portname empty";
        internal static string Cant_be_set_when_open = "can not be set when open";
        internal static string ArgumentOutOfRange_NeedPosNum = "ArgumentOutOfRange NeedPosNum";
        internal static string Port_not_open = "port not open";
        internal static string ArgumentOutOfRange_Bounds_Lower_Upper = "ArgumentOutOfRange Bounds Lower Upper";
        internal static string ArgumentOutOfRange_Timeout = "Argument OutOfRange Timeout";
        internal static string ArgumentOutOfRange_WriteTimeout = "Argument OutOfRange WriteTimeout";

        internal static string? Format(params object[] strings)
        {// 如果传入空数组，返回空字符串
            if (strings == null || strings.Length == 0)
                return string.Empty;

            // 使用string.Concat拼接字符串数组
            return string.Concat(strings);
        }
    }
}